package shopping.model;

import shopping.commons.ModelObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: mazhao
 * Date: 2010/10/30
 * Time: 22:16:40
 * To change this template use File | Settings | File Templates.
 */
public class ProvinceData extends ModelObject {
    private int id;
    private String name;
    private String description;
    private List<City> cities;

    public ProvinceData() {
    }

    public ProvinceData(int id, String name, String description) {
        this.id = id;
        this.name = name;
        this.description = description;
    }

    public List<City> getCities() {
        return cities;
    }

    public void setCities(List<City> cities) {
        this.cities = cities;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public synchronized void addCity(City c) {
        if (cities == null) {
            cities = new ArrayList<City>();
        }
        cities.add(c);
    }
}
